
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../jsLibs/jquery-2.x.js"></script>

<link href="../jsLibs/print.min.css?_v=601" rel='stylesheet'/>
<script src="../jsLibs/print.min.js?_v=601"></script>

<title>printJS + jsPDF : 网页转PDF下载</title>
<style type="text/css">

</style>
</head>
<body>

<div id="page1">

  <p id="p1">printJS + jsPDF : 网页转PDF下载</p>
  <p id="p2">1. 原文链接：https://blog.csdn.net/qq_42660374/article/details/129530167</p>
  <p id="p3">2. 原文链接：https://blog.csdn.net/G_ing/article/details/128429658</p>
</div>


<button onclick="pdfDown1()">printJS-pdfDown1</button>
<button onclick="pdfDown2()">jsPDF-pdfDown2</button>

<!--

-->
<script>

function pdfDown2(){
    printJS({
        printable: 'page1',
        type: 'html',
        background:true, //showModal: true ,
        css: ['/static/weys/weys.css?_v=P0','/static/erp/comm.css?_v=P1'],
        style: `
        body{ background:#FFF; }
        #page1{ padding:1rem; }
        @page {
            size: 21cm 29.7cm;
            margin: 5mm 5mm 5mm 5mm;
        }`
    });
}

function pdfDown1() {
    alert('略');
}
</script>

</body>
</html>

